﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'P_InsertUser')
	BEGIN
		DROP  Procedure  [esf_sso].P_InsertUser
	END

GO

CREATE Procedure [esf_sso].P_InsertUser
	@pPersonID					BIGINT
   ,@pAlias						VARCHAR (20)
   ,@pPassword					VARCHAR (160)
   ,@pIsEnabled					BIT
   ,@pCreationDateTime			DATETIME
   ,@pUserCreationAlias			VARCHAR (20)
   ,@pSecurityQuestionID		BIGINT
   ,@pSecurityQuestionAnswer	VARCHAR (60)
AS
	INSERT INTO [esf_sso].[User]
	   ([PersonID]
	   ,[Alias]
	   ,[Password]
	   ,[IsEnabled]
	   ,[CreationDateTime]
	   ,[UserCreationAlias]
	   ,[SecurityQuestionID]
	   ,SecurityQuestionAnswer)
	VALUES
	   (@pPersonID
	   ,@pAlias
	   ,@pPassword
	   ,@pIsEnabled
	   ,@pCreationDateTime
	   ,@pUserCreationAlias
	   ,@pSecurityQuestionID
	   ,@pSecurityQuestionAnswer)
	  
GO